//
//  CollectHandle.m
//  CWRD
//
//  Created by lanou on 15/9/21.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "CollectHandle.h"
#import "DetailModel.h"

@implementation CollectHandle

static CollectHandle *collect;
+ (CollectHandle *)shareCollectVideo {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if (collect == nil) {
            collect = [[CollectHandle alloc] init];
            collect.isCollected = NO;
        }
    });
    return collect;
}

- (NSMutableArray *)modelArray {
    if (!_modelArray) {
        _modelArray = [[NSMutableArray alloc] init];
    }
    return _modelArray;
}

- (NSMutableArray *)collectArray {
    if (!_collectArray) {
        _collectArray = [[NSMutableArray alloc] init];
    }
    return _collectArray;
}

//收藏-放入数组
- (void)collect {
    DetailModel *model = self.modelArray[self.index];
    [self.collectArray addObject:model];
}
- (void)cancelCollect {
    DetailModel *model = self.modelArray[self.index];
    [self.collectArray removeObject:model];
}





@end
